from django.urls import re_path, path, include
from django.views.static import serve
from django.conf import settings
from rest_framework import routers
from . import views
from . import dviews

router = routers.DefaultRouter()
# router.register(r"index", views.HelloWorld, basename="00测试页面")
# router.register(r"upload", views.FileUploadListModelViewSet, basename="10本地文件上传")

# router.register(r"hasCode", views.HasWechatCodeLoginViewSet, basename="20登录二维码")
router.register(r"UserLogin", views.UserPassLoginViewSet, basename="20登录认证账户")
router.register(r"Userinfo", views.UserInfoLoginViewSet, basename="21微信用户个人信息")
router.register(
    r"QiniuUpToken", views.HasQiniuUpTokenViewSet, basename="30七牛上传凭证"
)
router.register(
    r"QiniuUpload", views.QiniuUploadListModelViewSet, basename="31七牛上传回调"
)
router.register(
    r"FilesList", views.FileUploadListModelViewSet, basename="32用户资源列表"
)

router.register(r"YlWxCourse", views.YlWxCourseViewSet, basename="40报名价签")
router.register(r"YlWxPlatform", views.YlWxPlatformCourseViewSet, basename="41活动名称")
router.register(r"YlWxSchool", views.YlWxSchoolGroupViewSet, basename="42场所单位")


router.register(r"postModels", views.postAniPortraitViewSet, basename="50模板列表")
router.register(r"playGrade", views.playAniPortraitViewSet, basename="51视频上墙")
router.register(r"listGrade", views.listAniPortraitViewSet, basename="52大屏播放")
router.register(r"postGrade", views.postAniPortraitTowViewSet, basename="53创建动画")
router.register(r"taskGrade", views.taskAniPortraitViewSet, basename="54提取任务")
router.register(r"overGrade", views.QiniuForAniPortModelViewSet, basename="55完结任务")


# 用户资源
router.register(r"userFiles", views.AllinpayUserPowerViewSet, basename="60用户资源")

urlpatterns = [
    path("", include(router.urls)),
    # path("media/", serve, {'document_root':settings.MEDIA_ROOT}, name='media')
    # path("index/", dviews.index.as_view()),
    # path("login/", dviews.login.as_view()),
    # path("dopost/", dviews.upload.as_view()),
    # path("dolist/", dviews.fileList.as_view()),
    # path("uptoken/", dviews.uptoken.as_view()),
    # path("upkey/", dviews.haskey.as_view()),
]
